package site.wuao.simplerxjava.base;

import rx.Observer;
import rx.Subscriber;

/**
 * 观察者
 *
 * @author wuao
 * @date 2017/11/10
 * @github {https://github.com/CoderWuao}
 * @blogs {http://wuao.site/}
 * @note -
 * ---------------------------------------------------------------------------------------------------------------------
 * @modified -
 * @date -
 * @github -
 * @blogs -
 * @note -
 */
public class RxObserver {
    /**
     * 创建观察者（接口）
     */
    private void createObserver() {
        Observer<String> observer = new Observer<String>() {

            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(String s) {

            }
        };
    }

    /**
     * 创建订阅者（抽象类，实现接口Observer）
     */
    private void createSubscriber() {
        Subscriber<String> subscriber = new Subscriber<String>() {

            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(String s) {

            }

            @Override
            public void onStart() {
                super.onStart();
            }
        };
    }
}
